## Loading required package: knitr
## Loading required package: readxl
## Loading required package: rebus
## Loading required package: scales
## 
## Attaching package: 'scales'
## The following object is masked from 'package:rebus':
## 
##     alpha
## Loading required package: tidyverse
## -- Attaching packages ----------------------------------------------------------------------------------------------------------------------- tidyverse 1.2.1 --
## v ggplot2 3.0.0     v purrr   0.2.5
## v tibble  1.4.2     v dplyr   0.7.6
## v tidyr   0.8.1     v stringr 1.3.1
## v readr   1.1.1     v forcats 0.3.0
## -- Conflicts -------------------------------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x ggplot2::alpha()    masks scales::alpha(), rebus::alpha()
## x readr::col_factor() masks scales::col_factor()
## x purrr::discard()    masks scales::discard()
## x dplyr::filter()     masks stats::filter()
## x dplyr::lag()        masks stats::lag()
## x stringr::regex()    masks rebus::regex()
## [[1]]
## [1] TRUE
## 
## [[2]]
## [1] TRUE
## 
## [[3]]
## [1] TRUE
## 
## [[4]]
## [1] TRUE
## 
## [[5]]
## [1] TRUE

LCA Impacts on Material Transport for Deconstruction

Add discussion about data sources here.

In the following code blocks, the Activity refers to the scenarios: decon for deconstruction, and demo for demolition.

Transport Data

# data for generating transport impact values
routes <- read_csv("data/TransportRoutes.csv")
## Parsed with column specification:
## cols(
##   Activity = col_character(),
##   SimpleEOLname = col_character(),
##   TransportLeg = col_character(),
##   Dist = col_integer(),
##   Unit = col_character(),
##   VehicleClass = col_character(),
##   CarbonFactor = col_double(),
##   EnergyFactor = col_double(),
##   CarbonImpact = col_double(),
##   EnergyImpact = col_double(),
##   CarbonPerProjectImpacts = col_double(),
##   EnergyPerProjectImpacts = col_double(),
##   Notes = col_character()
## )
house_weight <- read_csv("intermediary/house_weight.csv")
## Parsed with column specification:
## cols(
##   contractor = col_character(),
##   project = col_integer(),
##   total_salvage_quantity = col_double(),
##   salvage_quantity_units = col_character(),
##   total_dropbox_quantity = col_double(),
##   dropbox_quantity_units = col_character(),
##   total_house_weight = col_double(),
##   total_house_weight_units = col_character(),
##   percent_salvaged = col_double(),
##   house_age = col_integer(),
##   house_size = col_integer()
## )
number_of_projects <- as.numeric(length(house_weight$project))

# data for material based transport impacts
material_name_mapping <- read_csv("intermediary/deconMaterialName_SimpleEOLname_mapping.csv")
## Parsed with column specification:
## cols(
##   X1 = col_integer(),
##   SimpleEOLname = col_character(),
##   deconMaterialName = col_character()
## )
# dropbox data for calculating dropbox transport
dropbox_EOL_weight <- read_csv("intermediary/dropbox_EOL_weight_composition.csv")
## Parsed with column specification:
## cols(
##   X1 = col_integer(),
##   contractor = col_character(),
##   project = col_integer(),
##   total_dropbox_quantity = col_double(),
##   quantity_units = col_character(),
##   SimpleEOLname = col_character(),
##   deconMaterialName = col_character(),
##   Distribution = col_double(),
##   disposition_assignment = col_character(),
##   percentage = col_double(),
##   disposition = col_character(),
##   kg_composition = col_double(),
##   dropbox_EOL_kg = col_double()
## )
# impact data for combining final results
decon <- read_csv("intermediary/deconData.csv")
## Parsed with column specification:
## cols(
##   X1 = col_integer(),
##   project = col_integer(),
##   contractor = col_character(),
##   house_age = col_integer(),
##   house_size = col_integer(),
##   deconMaterialName = col_character(),
##   quantity = col_double(),
##   quantity_units = col_character(),
##   disposition = col_character(),
##   impact_category = col_character(),
##   material_impacts = col_double(),
##   material_impact_units = col_character(),
##   SimpleEOLname = col_character()
## )
demo <- read_csv("intermediary/demoData.csv")
## Parsed with column specification:
## cols(
##   X1 = col_integer(),
##   house_age = col_integer(),
##   house_size = col_integer(),
##   project = col_integer(),
##   contractor = col_character(),
##   deconMaterialName = col_character(),
##   quantity = col_double(),
##   quantity_units = col_character(),
##   disposition = col_character(),
##   impact_category = col_character(),
##   material_impacts = col_double(),
##   material_impact_units = col_character(),
##   SimpleEOLname = col_character()
## )

Project Based Values

The transport calculation on a project basis involves workers for both scenarios. For the demolition projects there are also equipment impacts.

Formula: project based impacts for each Activity, multiply the Carbon or Energy ...PerProjectImpacts by the number of projects

projects <- distinct(select(decon, c("house_age", "house_size", "project", "contractor")))

# create the labor & equipment tables and save for later
# combine per project worker transport to the larger material based impact data frames later

per_project_worker_equipment <- bind_rows(projects, projects) %>%
   add_column(decon_workers = c(rep(as.numeric(routes[1,11]),number_of_projects), rep(as.numeric(routes[1,12]),number_of_projects))) %>%
   add_column(demo_workers = c(rep(as.numeric(routes[9,11]),number_of_projects), rep(as.numeric(routes[9,12]),number_of_projects))) %>%
   add_column(demo_equipment = c(rep(as.numeric(routes[14,11]),number_of_projects), rep(as.numeric(routes[14,12]),number_of_projects))) %>%
   add_column(impact_units = c(rep("kg CO2e", number_of_projects), rep("MJ", number_of_projects) ))

write.csv(per_project_worker_equipment, "intermediary/per_project_worker_equipment_transport_impacts.csv")

Material Weight Based Values

To calculate impacts of the transport of materials from the projects under the two activity scenarios, the weight of the materials and the materials destinations based on the EOL dispositions must be folded into the equation. For each scenario, there are two tranpsort legs that need to be modeled, first: from site to either retail or transfer station, and second: from transfer station to the end use (EOL) disposition (post-retail transport is beyond the bounds of this analysis). Distances between the projects and the material transfer and the EOL destination (recycler, landfill, or burner) are incorporated into the transport impact values. The following data tables are therefore project, material, and dipsosition specific in order to answer questions regarding the contributions of transport impacts on the activity scenarios. The following general formula will be used to calculate the material based transport impacts:

Formula: material based impacts for each Activity, multiply the Carbon or Energy Impacts by weight of the given material denoted by the SimpleEOLname

The material transport factors for the second transport leg (from MRF transfer to final EOL disposition) is the same for the decon and demo activity scenarios, therefore a table of transfer to EOL values will be used for joining to the scenario data frames in order to calculate impacts by material weight based on the EOL assignment. The transfer_to_EOL object will be used for the decon dropbox fate as well as the second transport leg for all materials in the demo scenario.

transfer_to_EOL <- routes %>%
   select("SimpleEOLname", "TransportLeg", "CarbonImpact", "EnergyImpact") %>%
   # pull out just the recoverable wood, metal, 
   slice(c(4:6)) %>% 
   add_row(SimpleEOLname = "nonrecoverable wood", TransportLeg = "transfer to landfill", CarbonImpact = as.numeric(routes[6,9]), EnergyImpact = as.numeric(routes[6,10]))

The site to transfer station transport impacts specific to the deconstruction dropbox receipts are calculated once and then used for both scenarios.

Dropbox Transport Impacts

# first leg: dropbox (site) to transfer station
# start with dropbox weight leaving off the index and build out columns
dropbox_EOL <- dropbox_EOL_weight[,-1] %>%
   add_column(carbon_impacts_per_kg_material_to_transfer = as.numeric(routes[3,9])) %>%
   add_column(energy_impacts_per_kg_material_to_transfer = as.numeric(routes[3,10])) %>%
   mutate(carbon_impacts_dropbox_to_transfer_kgCO2e = dropbox_EOL_kg * carbon_impacts_per_kg_material_to_transfer) %>%
   mutate(energy_impacts_dropbox_to_transfer_MJ = dropbox_EOL_kg * energy_impacts_per_kg_material_to_transfer)

# second leg: dropbox transfer station to EOL disposition
dropbox_EOL <- dropbox_EOL %>%
   left_join(transfer_to_EOL, by = "SimpleEOLname") %>%
   mutate(carbon_impacts_transfer_to_EOL_kgCO2e = dropbox_EOL_kg * CarbonImpact) %>%
   mutate(energy_impacts_transfer_to_EOL_MJ = dropbox_EOL_kg * EnergyImpact)

rm(dropbox_EOL_weight)
write.csv(dropbox_EOL, "intermediary/dropbox_EOL_transport_impacts.csv")

This final table saved for the calculation of dropbox materials, titled dropbox_EOL_transport_impacts.csv contains the following information: * project and total_dropbox_quantity in kilograms * associated SimpleEOLname and deconMaterialName for cross referencing materials and material fate * Distribution which is the assigned waste composition of each projects’ dropbox materials. The product of the total_dropbox_quantity and the Distribution is the kg_composition value. * the disposition_assignment is used to reference the disposition percentage, which in turn is used to assign the percentage of the kg_composition value for the fate of that material, which yields the dropbox_EOL_kg. * dropbox_EOL_kg is the weight value column used for calculating the transport leg impacts, which are labeled according to impact category and transport leg. * Final results for the two transport legs (site-to-transfer and transfer-to-EOL) are located in the following columns: carbon_impacts_dropbox_to_transfer_kgCO2e, energy_impacts_dropbox_to_transfer_MJ, carbon_impacts_transfer_to_EOL_kgCO2e, energy_impacts_transfer_to_EOL_MJ.

Transport impacts must still be organized by project, transport leg, and material type (deconMaterialName) before combining with the activity scenario data frames.

dropbox_site_transport <- dropbox_EOL %>%
   select("contractor", "project", "total_dropbox_quantity", "quantity_units", "SimpleEOLname", "deconMaterialName", "Distribution", "disposition_assignment", "percentage", "disposition",  "kg_composition", "dropbox_EOL_kg", "carbon_impacts_per_kg_material_to_transfer", "energy_impacts_per_kg_material_to_transfer", "carbon_impacts_dropbox_to_transfer_kgCO2e", "energy_impacts_dropbox_to_transfer_MJ") %>%
   rename(kgCO2e = carbon_impacts_dropbox_to_transfer_kgCO2e) %>%
   rename(MJ = energy_impacts_dropbox_to_transfer_MJ) %>%
   gather(`kgCO2e`, `MJ`, key = dropbox_to_transfer_units, value = dropbox_to_transfer) %>%
   select("contractor", "project", "SimpleEOLname", "deconMaterialName", "disposition", "dropbox_EOL_kg", "dropbox_to_transfer_units", "dropbox_to_transfer")

dropbox_EOL_transport <- dropbox_EOL %>%
   select("contractor", "project", "total_dropbox_quantity", "quantity_units", "SimpleEOLname", "deconMaterialName", "Distribution", "disposition_assignment", "percentage", "disposition",  "kg_composition", "dropbox_EOL_kg", "TransportLeg", "CarbonImpact", "EnergyImpact", "carbon_impacts_transfer_to_EOL_kgCO2e", "energy_impacts_transfer_to_EOL_MJ") %>%
   rename(kgCO2e = carbon_impacts_transfer_to_EOL_kgCO2e) %>%
   rename(MJ = energy_impacts_transfer_to_EOL_MJ) %>%
   gather(`kgCO2e`, `MJ`, key = transfer_to_EOL_units, value = transfer_to_EOL) %>%
   select("contractor", "project", "SimpleEOLname", "deconMaterialName", "disposition", "dropbox_EOL_kg", "transfer_to_EOL_units", "transfer_to_EOL")

Deconstruction Scenario

For the first transportation leg, all salvaged materials are going from the project site to the retailer. For salvaged materials that go to retail, there is no second transport leg, however, due to the need to model comparible scenario activity a column of zeros are added to the salvage material transport impacts as place holders for the second transport leg.

decon$material_impact_units <- str_replace(decon$material_impact_units, " ", "")

decon_transport <- decon %>%
   rename(impact_units = material_impact_units) %>%
   mutate(site_to_retail_transport_impact = case_when(
      disposition == "reuse" & impact_units == "kgCO2e" ~ quantity * as.numeric(routes[2,9]),
      disposition == "reuse" & impact_units == "MJ" ~ quantity * as.numeric(routes[2,10]))
      ) %>%
   left_join(dropbox_site_transport, by = c("project", "contractor", "deconMaterialName", "disposition", "SimpleEOLname", c("quantity" = "dropbox_EOL_kg"), c("impact_units" = "dropbox_to_transfer_units") )) %>%
   left_join(dropbox_EOL_transport, by = c("project", "contractor", "deconMaterialName", "disposition", "SimpleEOLname", c("quantity" = "dropbox_EOL_kg"), c("impact_units" = "transfer_to_EOL_units") )) %>%
   mutate(site_transport_impact = if_else(
      disposition == "reuse", .$site_to_retail_transport_impact, .$dropbox_to_transfer)) %>%
   mutate(EOL_transport_impact = if_else(
      disposition == "reuse", 0, .$transfer_to_EOL
   )) %>%
   select("house_age", "house_size", "project", "contractor", "deconMaterialName", "SimpleEOLname", "disposition", "quantity", "quantity_units", "material_impacts", "site_transport_impact", "EOL_transport_impact", "impact_units")


# save this file for the final net benefits calculation and for exploratory graphics
write.csv(decon_transport, "intermediary/final_deconstruction_scenario_with_transport.csv")

Demolition Scenario

Under the demolition scenario we model the salvaged materials as if they were all delivered by a class 8 vehicle in a dropbox to a transfer station, and from the transfer station by a class 8 vehicle to the disposition, which is either the recovery end use or landfill. The EOL data is used to redistribute the recovery of (salvaged) materials as if the materials had arrived in a combined dropbox at a transfer station and was recovered according to Metro’s regional recovery rates.

# first need transfer_to_EOL reshaped
transfer_to_EOL <- gather(transfer_to_EOL, `CarbonImpact`, `EnergyImpact` , key = "impact_type", value = "impact_value") %>%
   add_column(impact_units = c(rep("kg CO2e", 4), rep("MJ", 4)))

demo_transport <- filter(demo, material_impacts != 0) %>%
   rename(impact_units = material_impact_units) %>%
   mutate(site_transport_impact = case_when(
      impact_units == "kg CO2e" ~ quantity * as.numeric(routes[3,9]),
      impact_units == "MJ" ~ quantity * as.numeric(routes[3,10]))) %>%
   left_join(transfer_to_EOL, by = c("SimpleEOLname", "impact_units") ) %>%
   mutate(EOL_transport_impact = quantity * impact_value) %>%
   select("house_age", "house_size", "project", "contractor", "deconMaterialName", "SimpleEOLname", "disposition", "quantity", "quantity_units", "material_impacts", "site_transport_impact", "EOL_transport_impact", "impact_units")
      
# save this file for the final net benefits calculation and for exploratory graphics
write.csv(demo_transport, "intermediary/final_demolition_scenario_with_transport.csv")